package me.keiwu.admin.controller;

import me.keiwu.admin.rpc.LogDonateRpc;
import me.keiwu.admin.util.bean.AuthorityConst;
import me.keiwu.pub.data.ResponseV2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by kei on 12/01/2018.
 */
@RestController
@RequestMapping("/api/donate")
public class DonateController {

    @Autowired
    private LogDonateRpc logDonateRpc;


    @PreAuthorize("hasAuthority('" + AuthorityConst.SUPER_ADMIN + "')")
    @RequestMapping("/repair")
    public ResponseV2 repair(String start) {
        logDonateRpc.repair(start);
        return ResponseV2.ok();
    }

}
